const arr = [
    (() =>
        import (
            /* webpackChunkName:'store-modules-token' */
            "./modules/token"
        ))(),
    (() =>
        import ( /* webpackChunkName:'store-modules-user' */ "./modules/user"))(),
    (() =>
        import ( /* webpackChunkName:'store-modules-order' */ "./modules/order"))(),
    (() =>
        import ( /* webpackChunkName:'store-modules-order' */ "./modules/common"))(),
];

export const modules = function(Vue, store) {
    return new Promise((resolve, reject) => {
        try {
            Promise.all(arr).then((v) => {
                Promise.all([
                        v[0].token(Vue, store),
                        v[1].user(Vue, store),
                        v[2].order(Vue, store),
                        v[3].common(Vue, store),
                    ])
                    .then(() => {
                        resolve();
                    })
                    .catch((v) => {
                        reject(v);
                    });
            });
        } catch (e) {
            reject(e);
        }
    });
};